package com.xy.objectadapter;


/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/11 14:40
 * @description
 */
public class Phone {

    public void charging(Voltage5V v) {
        int src = v.output5V();
        if (src <= 5 && src > 0) {
            System.out.println("电压 = " + src + "伏,可以充电...");
        } else if (src > 5) {
            System.out.println("电压过高");
        } else {
            System.out.println("没有充电...");
        }
    }
}